{template "guest_header"}

<style type="text/css">
.reg_conbg {
    background: url("../images/btbg.png") no-repeat scroll center bottom transparent;
    margin: 0 5px;
    min-height: 270px;
    overflow: hidden;
    padding-bottom: 150px;
}
.notice2 {
    text-align: center;
}

.notice2 p {
    font-size: 14px;
    margin-left: 230px;
    padding: 3px 0;
    text-align: left;
}
.notice3 {
    border-top: 0px dotted #D9D9D9;
    margin: 5px 130px 20px;
    padding-top: 20px;
	
}
.notice3 strong {
    display: block;
    font-size: 14px;
    font-weight: bold;
    padding-bottom: 10px;
}
.notice3 p {
    clear: both;
    line-height: 1.8;
	overflow:hidden;
}
element.style {
    color: #0082CB;
    font-size: 14px;
    font-weight: bold;
}

</style>


<script type="text/javascript">

function getCookie(objName){//获取指定名称的cookie的值
    var arrStr = document.cookie.split("; ");
    for(var i = 0;i < arrStr.length;i ++){
        var temp = arrStr[i].split("=");
        if(temp[0] == objName) return unescape(temp[1]);
   }
}


function addCookie(objName,objValue,objTime){      //添加cookie
    var str = objName + "=" + escape(objValue);
    if(objTime > 0){                               //为时不设定过期时间，浏览器关闭时cookie自动消失
        var date = new Date();
        var ms = objTime*1000;
        date.setTime(date.getTime() + ms);
        str += "; expires=" + date.toGMTString();
   }
   document.cookie = str;
}


function add_checkemail(uid,email,checktype)
{
	//判断时间
	var date = new Date();
	if(!getCookie('emailsend')){
		var uid='undefined'==typeof(uid) ? '0': uid;
		
		//date_email = post 过来的 email
		var date_email = $('#'+email).val();
		var date_email = ('undefined' == typeof(date_email) ? '' : date_email);
		
		//email =  js过来的email
		var email = ('undefined' == typeof(email) ? '' : email);
		
		var checkemail = date_email ? date_email : email;
		
		var email_value = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;

	   if(!email_value.test(checkemail)){
			 show_message('提示\n\n请输入有效的E_mail',1);
			 $('#email').focus();
			 return false;
		}
		
		 $("#email_loading").html("<div><center><span class='loading'>验证邮件正在放送中，请稍候……</span></center></div>");
		
			var myAjax=$.post
			(
				"index.php?mod=member&code=check_modify_email",
				
				{
					uid:uid,
					email:checkemail,
					checktype:checktype
				},
				
				function(d)
				{//alert(d);
					if(''!=d)
					{
						show_message(d,2);
						$("#email_loading").html("");
						//parent.document.getElementById('user_email').innerHTML=checkemail;
					}
				}
			);
			addCookie('emailsend','1','60');
	}else{
		show_message('每次发送邮件间隔60秒，请稍等…',2);
	}
}

</script>


<div class="g-bd">  
  <div class="m-tit">
  帐户激活
  </div>

 <div class="m-box">
 <div class="m-help">进入邮箱，按邮件提示完成帐户激活</div>
  <div class="m-reg">


	<div class="notice3">
		<p>
		激活邮件已经发送到邮箱<a href="http://{$email_url}" target=_blank><span id="user_email">{$members[email]}</span></a>，
		点击邮件里的确认链接，来完成帐户激活。
		</p><br>
		<p>
		<span><a id="submit" title="立即查看邮箱" href="http://{$email_url}" style="float:left"><img src="images/email.gif" /></a></span>
		<span style="float:left;padding:15px 0 20px 20px;">或者<a href="/">直接进入我的首页</a></span>
		</p>
	</div>
	
	<div class="notice3">
	<strong>还没有收到确认邮件？</strong>
	
	<p>	1、 请看看邮件是否被放到垃圾邮件目录中了？
	<p> 2、 如果确实没收到，
	<a href="javascript:void(0);" onclick="add_checkemail('{$members[uid]}','{$members[email]}'); return false;"><span style=" font-size:12px;font-weight:bold;">点此再次发送邮件</span></a>；或者换个邮箱重新发送激活邮件，
	<a href="javascript:void(0);" onclick="getElementById('check_email').style.display=(getElementById('check_email').style.display=='none')?'':'none'">
	<span style="font-size:12px;font-weight:bold;">点此修改邮箱</span></a>。

	</div>
	<div id="email_loading"></div>
	<div class="" id="check_email" style="display:none;">
		<form action="{$action}" method="POST" enctype="multipart/form-data" name="check_email_form"   id="check_email_form" >
		<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
		  <tr>
			<td height="30" align="left"><strong>在下面填写新的邮箱，然后点击修改并发送按钮</strong></td>
		  </tr>
		  <tr>
			<td height="30" align="center"><input type="text" name="email" id="email" value=""  /><input class="u-btn u-btn-lg" type="button" name="Submit" value="修改并发送" onclick="add_checkemail('{$uid}','email','modify'); return false;"/></td>
		  </tr>

		  </table>
		</form>
	</div>
</div>
</div>

{template "topic_footer"}
